from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, func
from .base import Base

class Participant(Base):
    __tablename__ = "participants"
    __table_args__ = {
        "comment": "参会者表",
    }
    id = Column(Integer, primary_key=True, comment="参会者主键",autoincrement=True)
    meeting_id = Column(Integer, ForeignKey("meetings.id"), nullable=False, index=True, comment="所属会议ID")
    user_id = Column(Integer, nullable=True, comment="用户ID（若为系统用户）")
    display_name = Column(String(200), comment="参会者显示名（可与 user 不同）")
    role = Column(String(50), comment="角色，如 host / attendee / presenter")
    joined_at = Column(DateTime, nullable=True, comment="加入会议时间")
